<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<head>
<title><ui:insert naname="pageTitle" />Juris Advocacia</title>
<link rel="StyleSheet" href="styles/default.css" type="text/css" />
</head>

<body>

<div id="wrapper">

<div id="info">
	
	<a4j:outputPanel  rendered="#{!authBean.logado}" >
	
	<h:form>
	<ul>
	<li>
		<h:graphicImage url="/images/login.png"/>
			<h:inputText value="#{authBean.login}" styleClass="campo"
			 title="#{msg.login}" required="true" id="login" requiredMessage="#{msg.error_login_required}"/>
	</li>
	<li>	
		<h:graphicImage url="/images/password.png"/>
			<h:inputSecret value="#{authBean.password}" styleClass="campo" title="#{msg.password}" id="password" binding="#{authBean.passwordInput}"/>
	</li>
	<li>	
		<h:commandButton value="#{msg.loginButton}" styleClass="button" action="#{authBean.validateUser}" />
	</li>	
	</ul>	
	</h:form>
	
	</a4j:outputPanel>
	
	<a4j:outputPanel rendered="#{authBean.logado}">
	<h:form>
	<ul>
	<li><h:outputText value="#{msg.greetings}, #{authBean.screenname}" /></li>
	<li><h:commandLink value="#{msg.viewProcess}" action="viewProcess" rendered="#{authBean.userLogado.role != 'admin'}"/></li>
	<li><h:commandLink value="#{msg.adminPanel}" action="adminPanel" rendered="#{authBean.userLogado.role == 'admin'}"/></li>
	<li><h:commandLink value="#{msg.logout}" action="#{authBean.logout}"/></li>
	</ul>
	</h:form>
	</a4j:outputPanel>
	
</div>
<div id="header">
<h:panelGroup styleClass="erro">
	<h:message for="login"/>
	<h:message for="password" />
	
	</h:panelGroup>
</div>
<div id="menu"><ui:insert name="menu" >
<h:form>

	<rich:toolBar styleClass="toolBar">

		<rich:dropDownMenu>
			<f:facet name="label">
				<h:commandLink value="#{msg.home}" action="home" />
			</f:facet>
		</rich:dropDownMenu>
		
		<rich:dropDownMenu>
			<f:facet name="label">
				<h:commandLink value="#{msg.office}" action="office" />
			</f:facet>
		</rich:dropDownMenu>

		<rich:dropDownMenu>
			<f:facet name="label">
				<h:commandLink value="#{msg.lawyers}" action="lawyers"/>
			</f:facet>
		</rich:dropDownMenu>
		
		<rich:dropDownMenu>
			<f:facet name="label">
		<h:commandLink value="#{msg.news}" action="news"/>
			</f:facet>
		</rich:dropDownMenu>
		
		<rich:dropDownMenu>
			<f:facet name="label">
		<h:commandLink value="#{msg.links}" action="links" />
			</f:facet>
		</rich:dropDownMenu>
		
		<rich:dropDownMenu>
			<f:facet name="label">
				<h:commandLink value="#{msg.contact}" action="contact"/>
			</f:facet>
		</rich:dropDownMenu>
				
	</rich:toolBar>
</h:form> 
</ui:insert>
</div>

<div class="shadowLeft"></div>
<div id="content"><ui:insert name="content" /></div>
<div id="shadowBottom"></div>

<div id="footer"><h:outputText value="#{msg.develop}"/></div>

</div>
</body>
</html>